package com.wxy.gks.springbootprojectday22practice.dao;

import com.wxy.gks.springbootprojectday22practice.bean.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface EmployeeMappe {

    public List<Employee>  findEmployees();
    @Delete("delete from employee where id=#{id}")
    public void delete(Integer id );

    public Employee getEmpById(Integer id);
    @Update("update employee set empName = #{empName},phone = #{phone},address = #{address},birthday = #{birthday},deptId = #{dept.deptId} where id = #{id} ")
    public void update(Employee emp);

    @Insert("insert into employee values(#{id},#{empName},#{phone},#{address},#{birthday},#{dept.deptId})")
    public void add(Employee emp);

}
